package com.LFLWZ.serivceImpl;

import com.LFLWZ.beans.POJO.ConcernLecturer;
import com.LFLWZ.beans.POJO.Lecturer;
import com.LFLWZ.beans.Vo.LerAndCrsVo;
import com.LFLWZ.beans.Vo.addLecturer;
import com.LFLWZ.mapper.LecturerMapper;
import com.LFLWZ.service.LecturerService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * (Lecturer)表服务实现类
 *
 * @author 淋漓
 * @since 2020-12-04 01:31:05
 */
@Service
public class LecturerServiceImpl implements LecturerService {

    @Autowired
    private LecturerMapper lecturerMapper;

    @Override
    public Lecturer select(Lecturer lecturer) {
        return lecturerMapper.select(lecturer);
    }

    @Override
    public Lecturer selByRoom(Integer id) {
        return lecturerMapper.selByRoom(id);
    }
    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public List<Lecturer> queryById(Integer id) {
        return this.lecturerMapper.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<Lecturer> queryAllByLimit(int offset, int limit) {
        return this.lecturerMapper.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param lecturer 实例对象
     * @return 实例对象
     */
    @Override
    public Lecturer insert(Lecturer lecturer) {
        this.lecturerMapper.insert(lecturer);
        return lecturer;
    }

    /**
     * 修改数据
     *
     * @param lecturer 实例对象
     * @return 实例对象
     */
    @Override
    public Lecturer update(Lecturer lecturer) {
        this.lecturerMapper.update(lecturer);
        return  null;
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.lecturerMapper.deleteById(id) > 0;
    }

    /***
     * 查询全部讲师表
     * @return
     */
    @Override
    public List<Lecturer> queryAll() {
        return lecturerMapper.queryAll();
    }

    @Override
    public List<LerAndCrsVo> selcourse(Integer id) {
        return lecturerMapper.selcourse(id);
    }

    @Override
    public int selCountCre(Integer id) {
        return lecturerMapper.selCountCre(id);
    }

    @Override
    public List<Lecturer> selExc() {
        return lecturerMapper.selExc();
    }

    @Override
    public int ins(addLecturer addLecturer) {
        return lecturerMapper.ins(addLecturer);
    }

    @Override
    public int del(ConcernLecturer concernLecturer) {
        return lecturerMapper.del(concernLecturer);
    }

    @Override
    public List<ConcernLecturer> seladd(ConcernLecturer concernLecturer) {
        return lecturerMapper.seladd(concernLecturer);
    }

    @Override
    public List<Lecturer> selLike(Lecturer lecturer) {
        return lecturerMapper.selLike(lecturer);
    }

    @Override
    public int selCount(Integer lecturerId) {
        return lecturerMapper.selCount(lecturerId);
    }
}